import java.io.*;
import java.util.Date;

class ObjectInputStreamTest {
    public static void main(String []args) {
        Date d = null;
        try {
            FileInputStream in = new FileInputStream("date.txt");
            ObjectInputStream oin = new ObjectInputStream(in);
            d = (Date)oin.readObject();
            System.out.println("d = " + d + ",toString() = " + d.toString());
            in.close();
            oin.close();
        } catch (Exception e) {
            System.out.println("exception : " + e.toString());
        }
    }
}
